/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Mechanica",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Demo.IServices;
using VOL.Demo.IRepositories;
using Microsoft.EntityFrameworkCore;
using VOL.Core.Filters;
using VOL.Core.Enums;
using Newtonsoft.Json.Serialization;
using Castle.DynamicProxy.Contributors;
using VOL.Entity.DomainModels.Core;
using VOL.Demo.Controllers;

namespace VOL.WebApi.Controllers.Demo.Partial
{
    [Route("api/Mechanica_xin")]
    public partial class Mechanica_xinController : MechanicaController
    {
        private readonly IMechanicaService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly IMechanica_records2Service _mechanica_Records2Service;
        private readonly IMechanica_records2Repository _mechanica_Records2Repository;
        [ActivatorUtilitiesConstructor]
        public Mechanica_xinController(
            IMechanicaService service,
            IHttpContextAccessor httpContextAccessor,
            IMechanica_records2Service mechanica_Records2Service,
            IMechanica_records2Repository mechanica_Records2Repository




        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
            _mechanica_Records2Service = mechanica_Records2Service;
            _mechanica_Records2Repository = mechanica_Records2Repository;

        }


        

        //[Route("getMechanica_Records2"), HttpPost]
        //public IActionResult GetMechanica_Records2([FromBody] PageDataOptions loadDate)
        //{
        //    var gridDate = _mechanica_Records2Service.GetPageData(loadDate);
        //    return JsonNormal(gridDate);

        //}
        //[Route("getMechanica_Records2Rows"), HttpGet]

        //public async Task<IActionResult> GetMechanica_Records2Rows(int Id)

        //{
        //    var rows = await _mechanica_Records2Repository.FindAsIQueryable(x => x.id == Id).ToListAsync();

        //    return JsonNormal(rows);
        //}
        //[HttpGet, Route("print")]
        //[ApiActionPermission("Mechanica", ActionPermissionOptions.Print)]
        //public IActionResult Print()
        //{
        //    return Content("打印的内容");
        //}

        public override ActionResult GetPageData([FromBody] PageDataOptions loadData)
        {

            loadData.Value = 1;
            return base.GetPageData(loadData);
        }




    }
}
